//
// Created by jiaxv on 25-8-13.
//

#ifndef AIR_H
#define AIR_H
#include "ldacs_corenet.h"
#include "ld_buffer.h"
#include "ld_santilizer.h"


typedef enum {
    SN_SESSION_EST_RQST = 0xC1,
    SN_SESSION_EST_RESP = 0xC2,
}SN_TYPE;

#pragma pack(1)
typedef struct sn_session_est_rqst_s {
    uint8_t SN_TYP;
    uint8_t VER;
    uint8_t PID;
    uint16_t AS_SAC;
    uint8_t SER_TYPE;
} sn_session_est_rqst_t;
extern struct_desc_t sn_session_est_rqst_desc;


typedef struct sn_session_est_resp_s {
    uint8_t SN_TYP;
    uint8_t VER;
    uint8_t PID;
    uint16_t AS_SAC;
    buffer_t *IP_AS;
} sn_session_est_resp_t;
extern struct_desc_t sn_session_est_resp_desc;

static void free_sn_session_est_resp(void *args) {
    sn_session_est_resp_t *resp = args;
    if (resp) {
        if (resp->IP_AS) {
            free_buffer(resp->IP_AS);
        }
        free(resp);
    }
}


#pragma pack()

#endif //AIR_H
